import React, { Component, PropTypes } from 'react';
import {
  Text,
  View,
  ScrollView,
  DeviceEventEmitter,
  Platform,
  NativeAppEventEmitter
} from 'react-native';

import ScrollableTabView from 'react-native-scrollable-tab-view';
import styles from './withdrawStyle';

import ProgressBar from '../global/ProgressBar';
import DefaultTabBar from '../global/scrollableTabView/DefaultTabBar';
import Button from '../global/scrollableTabView/Button';

import WithdrawList from './withdrawList';

class WithdrawInfo extends Component {
    constructor(props) {
		super(props);

		this.state = {
			isLoading: true,
			isRefreshing: false,
			tab: 0
		};

		// this._getTabHeight = this._getTabHeight.bind(this);
		this._onChangeTab = this._onChangeTab.bind(this);

		// this.props.navigator.setOnNavigatorEvent(this._onNavigatorEvent.bind(this));
	}
    componentWillMount() {
		// this._retrieveDetails();
	}

    componentDidMount(){

    }

    _onChangeTab({ i, ref }) {
		this.setState({ tab: i });
	}

    // _onNavigatorEvent(event){
    //     if (event.type === 'ScreenChangedEvent') {
	// 		if (event.id === 'didAppear') {//出现时
    //
	// 		}
	// 	}
    // }

    componentWillUnmount(){
        // this._subcribOrder && this._subcribOrder.remove();
    }

    render() {
        return (
            <ScrollableTabView
                onChangeTab={this._onChangeTab}
                renderTabBar={() => (
                    <DefaultTabBar
                        activeTextColor={"#EA5404"}
                        inactiveTextColor={"#555555"}
                        textStyle={styles.textStyle}
                        underlineStyle={styles.underlineStyle}
                        style={[styles.tabBar,{height:0}]}
                    />
                )}>
                <WithdrawList
                    tabLabel="全部"
                    tab={0}
                    parent={this}
                    navigator={this.props.navigator}/>
            </ScrollableTabView>
        );
    }
}

var connectHelper = require('../../services/connectHelper');
WithdrawInfo = connectHelper(state => state)(WithdrawInfo);

module.exports = WithdrawInfo;
